<span id="${uuid}"></span>

<div data-id="content" class="box_tc_s">
    <form data-id="form-attendance-update-info" method="post"
          action="${pageContext.request.contextPath}/app/api/attendance/update">
        <input type="hidden" name="id" value="${attendance.id}">
        <table border="0" cellpadding="0" cellspacing="0" class="hydra-table">
            <tr class="hydra-tr-bg">
                <td class="hydra-left width90">人员：</td>
                <td class="hydra-right">
                    ${attendance.applyUser.orgsDescription} - ${attendance.applyUser.userName}
                </td>
            </tr>
            <tr class="hydra-tr-bg">
                <td class="hydra-left width90">填报人：</td>
                <td class="hydra-right">
                    ${attendance.createUser.orgsDescription} - ${attendance.createUser.userName}
                    <c:if test="${attendance.isReplace eq 1}">
                        (代填)
                    </c:if>
                </td>
            </tr>
            <tr class="hydra-tr-bg">
                <td class="hydra-left width90">填报时间：</td>
                <td class="hydra-right">
                    <%--<fmt:formatDate value="${attendance.createTime}" pattern="yyyy-MM-dd HH:mm"/>--%>
                    <input type="text" class="hydra-input-width" data-id="createTime" value="${attendance.createTime}"
                           name="createTime" data-options="required:true,editable: false"/>
                </td>
            </tr>
            <tr class="hydra-tr-bg">
                <td class="hydra-left width90"><span class="nes-tip">*</span>考勤事由：</td>
                <td class="hydra-right">
                    <select data-id="reason" name="reason.id" data-options="required:true,editable: false"
                            class="easyui-validatebox hydra-input-width"></select>
                </td>
            </tr>
            <%--<tr class="hydra-tr-bg" data-id="pCodeItem"--%>
            <%--<c:if test="${empty attendance.projectCode}">style="display: none"</c:if>--%>
            <%-->--%>
            <%--<td class="hydra-left width90"><span class="nes-tip">*</span>项目代号：</td>--%>
            <%--<td class="hydra-right">--%>
            <%--<input type="text" name="projectCode" data-id="projectCode"--%>
            <%--class="easyui-validatebox hydra-input-width"--%>
            <%--data-options="required:true,validType:['normalChar','length[0,20]']"--%>
            <%--placeholder="项目代号.." value="${attendance.projectCode}"/>--%>
            <%--</td>--%>
            <%--</tr>--%>
            <tr>
                <td class="hydra-left width90"><span class="nes-tip">*</span>备注：</td>
                <td class="hydra-right"><textarea
                        data-id="remark" name="remark"
                        class="easyui-validatebox hydra-textarea hydra-input-width" draggable="false"
                        data-options="required:true,validType:['normalChar','length[0,200]']"
                        placeholder="备注..">${attendance.remark}</textarea></td>
            </tr>
            <tr class="hydra-tr-bg">
                <td class="hydra-left width90"><span class="nes-tip">*</span>开始时间：</td>
                <td class="hydra-right">
                    <div data-id="hourBegin" <c:if test="${not empty attendance.apm}">style="display: none"</c:if>>
                        <input type="text" class="hydra-input-width" data-id="beginTime" value="${attendance.beginTime}"
                               name="beginTime" data-options="required:true,editable: false"/>
                    </div>
                    <div data-id="dayBegin" <c:if test="${empty attendance.apm}">style="display: none"</c:if>>
                        <input type="text" class="hydra-input-width" data-id="beginTime1" style="width: 300px"
                               value='<fmt:formatDate value="${attendance.beginTime}" pattern="yyyy-MM-dd"/>'
                               name="beginTime1" data-options="required:true,editable: false"
                               <c:if test="${empty attendance.apm}">disabled="disabled"</c:if>/>
                        <select data-id="apm" name="apm" class="hydra-input-width" style="width: 95px">
                            <option value="am" <c:if test="${attendance.apm eq 'am'}">selected="selected"</c:if>>上午
                            </option>
                            <option value="pm" <c:if test="${attendance.apm eq 'pm'}">selected="selected"</c:if>>下午
                            </option>
                        </select>
                    </div>
                </td>
            </tr>
            <c:if test="${'0' ne attendance.status}">
            <tr class="hydra-tr-bg">
                <td class="hydra-left width90">
                    <div data-id="hourBegin" <c:if test="${not empty attendance.apm}">style="display: none"</c:if>>
                        结束时间：
                    </div>
                    <div data-id="dayBegin" <c:if test="${empty attendance.apm}">style="display: none"</c:if>>考勤天数：
                    </div>
                </td>
                <td class="hydra-right">
                    <div data-id="hourBegin" <c:if test="${not empty attendance.apm}">style="display: none"</c:if>>
                        <input type="text" class="hydra-input-width" data-id="endTime"
                            <%--<c:choose>--%>
                            <%--<c:when test="${empty attendance.endTime}">--%>
                            <%--value="<fmt:formatDate value='${now}' pattern='yyyy-MM-dd HH:mm'/>"--%>
                            <%--</c:when>--%>
                            <%--<c:otherwise>--%>
                               value="${attendance.endTime}"
                            <%--</c:otherwise>-
                        <%--</c:choose>--%>
                               name="endTime" data-options="editable:false"
                               validType="compareDate['${uuid}','beginTime']" invalidMessage="结束时间应大于开始时间"
                               <c:if test="${not empty attendance.apm}">disabled="disabled"</c:if>/>
                    </div>
                    <div data-id="dayBegin" <c:if test="${empty attendance.apm}">style="display: none"</c:if>>
                        <input type="text" class="easyui-numberbox easyui-validatebox hydra-input-width"
                               value="${attendance.days}"
                               data-id="days" name="days" data-options="min:0.5,precision:1"
                               <c:if test="${empty attendance.apm}">disabled="disabled"</c:if>/>
                    </div>
                </td>
                </c:if>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">
    seajs.use(["apps/attendance/countList"], function (page) {
        page.update("${pageContext.request.contextPath}", "${uuid}", {
            reasonId: "${attendance.reason.id}",
            projectCode: "${attendance.projectCode}"
        });
    });
</script>
